// 规则
function Rule(object) {
  var obj = object
  const tipMsg = '不能为空'

  // 设置部门规则
  this.setDeptNbrRules = function() {
    obj.rules.deptNbr = [
      { required: true, message: tipMsg, trigger: 'blur' },
      { required: true, message: tipMsg, trigger: 'blur' }
    ]
  }

  // 设置细分类Nbr规则
  this.setFinelineNbrsRules = function() {
    obj.rules.selectedFinelineNbrs = [
      { required: true, message: tipMsg, trigger: 'blur' },
      { required: true, message: tipMsg, trigger: 'blur' }
    ]
  }

  // 初始化校验规则
  this.initRules = function() {
    for (var key in this) {
      if (key === 'initRules') {
        continue
      }
      if (typeof (this[key]) === 'function') {
        this[key]()
      }
    }
  }
}
export default Rule
